{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 参数估计和假设检验\n",
    "## 区间估计\n",
    "## 经验分布函数\n",
    "经验分布函数: $F_n(x)=\\frac{1}{n}S(x),\\ -\\infty<x<\\infty$, 其中$S(x)$表示$X_1,X_2,\\cdots,X_n$中不大于$x$的随机变量个数.\n",
    "## Q-Q图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Q-Q图\n",
    "#     x: 数据\n",
    "#     F_inv: 分布函数F(x;theta)的逆函数\n",
    "\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "def QQplot(x, F_inv):\n",
    "    x = np.array(x)\n",
    "    n = x.shape[0]\n",
    "    x.sort()\n",
    "    y = np.apply_along_axis(F_inv, axis=0, arr=[(i - 1 / 2) / n for i in range(1, n + 1)])\n",
    "    plt.scatter(x, y)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
